package com.hsp.homework.homework8;

public class BankAccount {
    private double balance;

    public BankAccount(double initBalance) {
        this.balance = initBalance;
    }

    //存款
    public void deposit(double amount){
        balance+=amount;
    }

    public void withdraw(double amount){
        balance-=amount;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }
}
